
package edu.moravian.player;

import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

/**
 *
 * @author szilagyi
 */
public class PlayerInfo
{
    private static final String PLAYER_PATH = "src/main/resources/player/player.ini";
    
    private static int monies;
    private static int livesRemaining;
    private static int enemiesKilled;
    private static int wave;

    static 
    {
        init();
    }
    
    private static void init()
    {
        Properties properties = new Properties();
        try
        {
            properties.load(new FileReader(PLAYER_PATH));
            
            monies = Integer.parseInt(properties.getProperty("monies"));
            livesRemaining = Integer.parseInt(properties.getProperty("lives"));

            enemiesKilled = 0;
            wave = 0;
                        
            
            
        }
        catch (IOException ex)
        {
            System.out.println("Cant load player settings");
            ex.printStackTrace();
            System.exit(-1);
        }
    }

    public synchronized static int getEnemiesKilled()
    {
        return enemiesKilled;
    }

    public synchronized static void setEnemiesKilled(int enemiesKilled)
    {
        PlayerInfo.enemiesKilled = enemiesKilled;
    }

    public synchronized static int getLivesRemaining()
    {
        return livesRemaining;
    }

    public synchronized static void setLivesRemaining(int livesRemaining)
    {
        PlayerInfo.livesRemaining = livesRemaining;
    }

    public synchronized static int getMonies()
    {
        return monies;
    }

    public synchronized static void setMonies(int monies)
    {
        PlayerInfo.monies = monies;
    }

    public synchronized static int getWave()
    {
        return wave;
    }

    public synchronized static void setWave(int wave)
    {
        PlayerInfo.wave = wave;
    }

  

  

    
    
}
